package com.example.shop.fragment;


import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.WindowManager;

import com.example.shop.R;
import com.example.sjlibrary.base.BaseFragment;

/**
 * A simple {@link Fragment} subclass.
 */
public class WelcomeFragment extends BaseFragment {
    public WelcomeFragment() {

    }
    private Handler mHandler = new Handler() {
        @Override
        public void handleMessage(Message msg) {
            super.handleMessage(msg);
            if (msg.what == 11111) {
                if (HomeFragment.isYJG){
                    HomeFragment.isYJG=false;
                    mBaseActivity.getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
                    killSelf();
                }else {
                    mHandler.sendEmptyMessageDelayed(11111, 500);
                }

            }
        }
    };


    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        super.onCreateView(inflater, container, savedInstanceState);
        mHandler.sendEmptyMessageDelayed(11111, 1000);
        return inflater.inflate(R.layout.fragment_welcome, container, false);
    }
}
